<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta charset="utf-8">
    <title>{$title|default=''|htmlentities} – {$site.name|htmlentities}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">

    {if isset($keywords)}
    <meta name="keywords" content="{$keywords|htmlentities}">
    {/if}
    {if isset($description)}
    <meta name="description" content="{$description|htmlentities}">
    {/if}

    <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />

    <link href="__CDN__/assets/css/frontend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="__CDN__/assets/js/html5shiv.js"></script>
    <script src="__CDN__/assets/js/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var require = {
            config: {$config|json_encode}
        };
    </script>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/project.css">
    <script src="http://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <!--<link href="__CDN__/assets/css/user.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
    <script src="__CDN__/assets/js/require{$Think.config.app_debug?'':'.min'}.js" data-main="__CDN__/assets/js/require-frontend{$Think.config.app_debug?'':'.min'}.js?v={$site.version|htmlentities}"></script>-->
</head>
<body style="background: #2b669a">
<style>
    .profile-avatar-container {
        position:relative;
        width:100px;
    }
    .profile-avatar-container .profile-user-img{
        width:100px;
        height:100px;
    }
    .profile-avatar-container .profile-avatar-text {
        display:none;
    }
    .profile-avatar-container:hover .profile-avatar-text {
        display:block;
        position:absolute;
        height:100px;
        width:100px;
        background:#444;
        opacity: .6;
        color: #fff;
        top:0;
        left:0;
        line-height: 100px;
        text-align: center;
    }
    .profile-avatar-container button{
        position:absolute;
        top:0;left:0;width:100px;height:100px;opacity: 0;
    }
    .cd{
        font-size: 12px;
        margin: 3px;
        margin-bottom: 20px;
    }
</style>
<div id="content-container" class="container">

    <div class="row">
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-body">
                    <h2 class="page-header">个人中心</h2>
                    <form id="profile-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('user/info')}">
<!--                        {:token()}-->
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-4">
                                <div class="profile-avatar-container">
                                    <img class="profile-user-img img-responsive img-circle" src="{$user.avatar|htmlentities|cdnurl}" alt="">
<!--                                    <div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>-->
<!--                                    <button type="button" id="faupload-avatar" class="faupload" data-mimetype="png,jpg,jpeg,gif" data-input-id="c-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>-->
                                </div>
                            </div>
                        </div>
                        <div class="row" style="width: 100%;">
                            <a href="{:url('cart')}" class="col-md-3 btn btn-danger cd">
                                <i class="glyphicon glyphicon-shopping-cart"></i>
                                购物车
                            </a>
                            <a href="{:url('order')}" class="col-md-3 btn btn-warning cd">
                                <i class="glyphicon glyphicon-list-alt"></i>
                                我的订单
                            </a>
<!--                            <a href="{:url('address')}" class="col-md-3 btn btn-primary cd">-->
<!--                                <i class="glyphicon glyphicon-map-marker"></i>-->
<!--                                我的地址-->
<!--                            </a>-->
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">用户名:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" class="form-control" id="username" name="username" value="{$user.username|htmlentities}" data-rule="required;username;remote({:url('api/validate/check_username_available')}, id={$user.id})" placeholder="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">昵称:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" class="form-control" id="nickname" name="nickname" value="{$user.nickname|htmlentities}" data-rule="required;remote({:url('api/validate/check_nickname_available')}, id={$user.id})" placeholder="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">手机号:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" class="form-control" id="mobile" name="mobile" value="{$user.mobile|htmlentities}" data-rule="required;mobile;remote({:url('api/validate/check_username_available')}, id={$user.id})" placeholder="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">我的地址:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" class="form-control" id="address" name="address" value="{$user.address}" placeholder="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">自提地址:</label>
                            <div class="col-xs-12 col-sm-4">
                                <input type="text" class="form-control" id="zt_address" name="zt_address" value="{$user.zt_address}" placeholder="">
                            </div>
                        </div>
                        <div class="form-group normal-footer">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-8">
                                <button type="submit" class="btn btn-primary btn-embossed disabled">确定</button>
                                <button type="reset" class="btn btn-default btn-embossed">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .form-layer {height:100%;min-height:150px;min-width:300px;}
    .form-body {
        width:100%;
        overflow:auto;
        top:0;
        position:absolute;
        z-index:10;
        bottom:50px;
        padding:15px;
    }
    .form-layer .form-footer {
        height:50px;
        line-height:50px;
        background-color: #ecf0f1;
        width:100%;
        position:absolute;
        z-index:200;
        bottom:0;
        margin:0;
    }
    .form-footer .form-group{
        margin-left:0;
        margin-right:0;
    }
</style>

<script>
    $('.login-btn').click(function(){
        var phone=$('#phone').val();
        var password=$('#password').val();
        $.ajax({
            url:"{:url('login')}",
            data:{phone:phone,password:password},
            type:"POST",
            success:function (res){
                if(res.code==0){
                    alert(res.msg);
                }else{
                    window.location.href="{:url('user/info')}";
                }
            }
        })
    })
</script>
</body>
</html>